{% set current_page='search' %}

{% extends 'federation/master.html' %}

{#
SPDX-FileCopyrightText:  2020-2021 zPlus <zplus@peers.community>
SPDX-License-Identifier: GPL-2.0-only
#}

{% block page_content %}

    <div class="mb-3">
        <form method="GET" action="" class="p-2">
            <div class="font-weight-bold mb-2">
                Search the federation (by URI)
            </div>

            <input type="url" name="uri" value="{{ uri if uri }}"
                   class="form-control input-lg"
                   placeholder="https://example.org/object" required>
            <input type="submit" class="mt-2" value="Search">

            {% if uri %}
                <div class="mt-5">
                    {% if result %}
                        {% include 'federation/search_result.html' %}
                    {% else %}
                        <i>Nothing found at URI {{ uri }}.</i>
                    {% endif %}
                </div>
            {% endif %}
        </form>
    </div>

{% endblock %}
